package com.ssc.olec;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;

public class OLECHome extends Activity 
{
	private TextView mChoice;
    private RadioGroup radioGroup;
    private RadioButton localSupport;
    private RadioButton webSupport;
    
    private Button 	   goButton;
    
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        radioGroup = (RadioGroup)findViewById(R.id.group1);
        localSupport 	= (RadioButton)findViewById(R.id.radio_local_support);
        webSupport		= (RadioButton)findViewById(R.id.radio_web_support);
        
        goButton = (Button)findViewById(R.id.go);
        goButton.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				
				if(R.id.radio_web_support==radioGroup.getCheckedRadioButtonId())
				{
					showAlert("Not Supported !","For Web Services Application \nPlease Contact :- \nMr. Rakesh Kumar Jha \nEmail - rkjhaw@hotmail.com \nMobile - +91 9886336619");
				}
				else
				{
					Intent indexIntent=new Intent(OLECHome.this,IndexActivity.class);
					startActivity(indexIntent);
				}
			}
		});
        
    }
    protected void showAlert(String title, String mymessage)
	   {
	   new AlertDialog.Builder(this)
	      .setMessage(mymessage) //.setPositiveButton( R.string.main_connection_button_ok_button, 
	      .setTitle(title)
	      .setPositiveButton("OK",
	    		  new DialogInterface.OnClickListener() {
	    	  			public void onClick(DialogInterface dialog, int whichButton)
	    	  			{
	    	  				dialog.dismiss();
	    	  			}
	         })
	      .show();
	   }
	


  
    
}